<style>
	.mpm-list-ico2 {
		color: #999;
		background: #fff;
		display: inline-block;
		padding: 2px;
		line-height: 12px;
		border: 1px solid #ccc;
	}
	.under-line {
		text-decoration: underline;
		color: rgb(41, 158, 236);
	}
</style>
<div class="panel">
  <div class="panel-body">
    <div class="col-lg-12">
      <div class="col-lg-2-4">
        <input type="text" class="form-control" placeholder="产品名称" ng-model="searchform.name">
      </div>
      <div class="col-lg-2-4">
        <ui-select ng-model="searchform.place_code" theme="bootstrap">
          <ui-select-match placeholder="请选择景区">{{$select.selected.name}}</ui-select-match>
          <ui-select-choices repeat="item.code as item in viewarr | filter: $select.search">
            <span ng-bind-html="item.name | highlight: $select.search"></span>
            <span ng-show="item.code">({{item.code}})</span>
          </ui-select-choices>
        </ui-select>
      </div>
      <div class="col-lg-2-4">
        <ui-select ng-model="searchform.state" theme="bootstrap">
          <ui-select-match placeholder="产品状态">{{$select.selected.name}}</ui-select-match>
          <ui-select-choices repeat="item.value as item in statusArr">
            <span ng-bind-html="item.name | highlight: $select.search"></span>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>
    <div class="col-lg-12 mt10">
      <div class="col-lg-2-4">
        <input type="text" class="form-control" placeholder="产品编号" ng-model="searchform.code">
      </div>
      <div class="col-lg-2-4">
        <ui-select ng-model="searchform.sale_category" theme="bootstrap">
          <ui-select-match placeholder="产品分类">{{$select.selected.label}}</ui-select-match>
          <ui-select-choices repeat="item.value as item in dictbytypelist | filter: $select.search">
            <span ng-bind-html="item.label | highlight: $select.search"></span>
          </ui-select-choices>
        </ui-select>
      </div>
      <div class="col-lg-2-4">
        <ui-select ng-model="searchform.channel_code" theme="bootstrap">
          <ui-select-match placeholder="请选择渠道">{{$select.selected.name}}</ui-select-match>
          <ui-select-choices repeat="item.code as item in channel_list | filter: $select.search">
            <span ng-bind-html="item.name | highlight: $select.search"></span>
          </ui-select-choices>
        </ui-select>
	  </div>
	  <div class="col-lg-2">
		<button type="submit" class="btn btn-info" ng-click="load()" style="width: 70%">查询</button>
	  </div>
    </div>
  </div>

  <div style="padding: 0px 15px;"> <div  class="line b-b"></div> </div>
  <div style="padding: 0px 15px;">
	
	  <b style="font-size: 18px">查询结果</b>&nbsp;&nbsp;&nbsp;&nbsp;
	  <span class="text-muted">共 <b>{{bigTotalItems || '0'}}</b> 个产品</span>
	
  </div>
  
  <div class="panel-body">
    <div class="table-responsive">
      <table class="table table-default table-condensed table-hover table-bordered table-pd20">
        <thead>
          <tr>
            <th style="min-width: 200px;">基本信息</th>
            <th style="width: 135px;">价格</th>
            <th class="text-center" style="width: 111px;">有效期</th>
            <th style="width: 90px;">产品状态</th>
            <th>售卖渠道
              <a class="btn btn-link under-line" style="padding: 0px 5px; vertical-align: baseline;" ng-click="myChannel()">默认渠道</a>
            </th>
			<th style="width: 103px;">公开销售</th>
			<th>操作</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="obj in objs">
            <td>
			  产品名称: {{obj.name_inside}}
              <br/> 产品编号: {{obj.code}}
              <br/> 产品分类: {{obj.sale_category_name}}
              <br/> 供应商名: {{obj.create_company_name}}
            </td>
            <td>
              分销价: <strong style="color: red;">{{obj.cost_price}}</strong> 元
              <br /> 指导价: <strong style="color: red;">{{obj.guide_price}}</strong> 元
              <br />市场价: {{obj.market_price}} 元
            </td>
            <td class="text-center">{{obj.periodstart}}<br />至<br />{{obj.periodend}}</td>
            <td>
              <br ng-show="obj.sale_apply_state_name == ''"/>{{obj.state_name}}
              <br/><span ng-show="obj.sale_apply_state_name != ''" ng-bind="obj.sale_apply_state_name"></span>
            </td>
            <td>
              <div ng-if="obj.sale_apply_state != 'new'">
                <span ng-bind-html="obj.channel_list_name"></span><br ng-show="obj.channel_list_name"/>
                <a class="btn btn-xs btn-link under-line" ng-click="setChannel(obj)">设置渠道</a>
              </div>
            </td>
            <td>
              <div ng-if="obj.sale_apply_state != 'new'">
                <label class="i-switch bg-success" style="margin-left: 15px;">
                  <input type="checkbox" ng-model="obj.is_selected3" ng-change="change2(obj, obj.is_selected3, $index)"><i></i>
                </label><br/>
                <a class="btn btn-xs btn-link" style="text-decoration: underline; color: rgb(41, 158, 236);" ng-click="setFxs(obj)">设置分销商</a>
              </div>
            </td>
            <td>
			  
			  <a ng-show="obj.state=='1'" ng-click="stop(obj.id)" class="btn btn-primary btn-xs">下架</a>
			  <a ng-show="(obj.state=='0' || obj.state=='2') && obj.sale_apply_state != 'apply_sale'" ng-click="start(obj.id)" class="btn btn-danger btn-xs">申请上架</a>
			  <a ng-click="edit(obj.id, obj.sale_category)" ng-show="(obj.state=='0' || obj.state == '2') && obj.sale_apply_state != 'apply_sale'"
			   class="btn btn-success btn-xs">编辑</a>
			  <a ng-click="del(obj.id)" ng-show="(obj.state=='0' || obj.state == '2') && obj.sale_apply_state != 'apply_sale'" class="btn btn-danger btn-xs">删除</a>
			  <a ng-show="obj.used_state=='1'" ng-click="usedstart(obj.id)" class="btn btn-primary btn-xs">允许消票</a>
			  <a ng-show="obj.used_state=='0'" ng-click="usedstop(obj.id)" class="btn btn-danger btn-xs">禁止消票</a>
			  <a ng-click="info(obj.id, obj.sale_category)" ng-show="obj.state == '1' || obj.sale_apply_state == 'apply_sale'" class="btn btn-warning btn-xs">详情</a>
			  <a ng-show="obj.state=='1' && obj.sale_apply_state == 'for_sale'" ng-click="offSale(obj.id)" class="btn btn-danger btn-xs">禁售</a>
			  <a ng-show="obj.state=='1' && obj.sale_apply_state == 'pause'" ng-click="onSale(obj.id)" class="btn btn-success btn-xs">恢复销售</a>
			  <a ng-click="distribution(obj.code, obj.sale_target_type)" class="btn btn-default btn-xs" ng-show="obj.sale_target_type == 1">分配经销商</a>
			  <a ng-click="skset(obj.id,obj.code,obj.name,obj.guide_price, obj.cost_price)" class="btn btn-default btn-xs" ng-show="(obj.sale_category).indexOf('S') == 0 && obj.state == 1">商客专用设置</a>
              <a ng-click="setImages(obj)" class="btn btn-default btn-xs" has-permission='weshop'>设置信息</a>
              <a ng-click="setPoster(obj)" class="btn btn-default btn-xs" has-permission='weshop'>设置海报</a>
              <a ng-show="obj.state=='1'" ng-click="xcxBuy(obj)" class="btn btn-primary btn-xs">小程序</a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="text-right">
	  <pagination total-items="bigTotalItems" ng-model="bigCurrentPage" ng-change="load()" previous-text="上一页" 
	   next-text="下一页" first-text="首页" last-text="尾页" max-size="5" boundary-links="true" rotate="false" 
	   items-per-page="itemsPerPage" class="m-t-none m-b">
      </pagination>
    </div>
  </div>
</div>